package henu.cn.androidhomework.Login;

import android.annotation.SuppressLint;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;

import henu.cn.androidhomework.R;

public class forgotPassword extends AppCompatActivity {
private Button Forgot;
    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    @SuppressLint("ResourceAsColor")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_forgot_password);
        Forgot=(Button)findViewById(R.id.Forgot);
        /**
         * 在代码中动态改变drawable中的资源文件(这里指的是button的属性)
         */
        GradientDrawable gd = new GradientDrawable();//创建drawabl
        gd.setGradientType(GradientDrawable.RECTANGLE);
        gd.setColor(R.color.Green_纯绿);
        gd.setCornerRadius(30);
        Forgot.setBackground(gd);

    }
}
